home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip: 2001 Haziran
/
CHIP Haziran2001.iso
/
prog
/
haziran
/
19
/
setup.exe
/
data.z
/
int_gui.frm
< prev
next >
Wrap
Text File
|
2001-04-11
|
10KB
|
331 lines
VERSION 5.00
Begin VB.Form int_gui
BorderStyle = 1 'Fixed Single
Caption = "Interrupt listener"
ClientHeight = 3348
ClientLeft = 48
ClientTop = 336
ClientWidth = 4968
Icon = "int_gui.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3348
ScaleWidth = 4968
StartUpPosition = 3 'Windows Default
Begin VB.Frame Frame1
Caption = "IRQ Selection"
Height = 2052
Left = 240
TabIndex = 6
Top = 120
Width = 4452
Begin VB.ComboBox ReqIrqList
Height = 288
ItemData = "int_gui.frx":0442
Left = 1200
List = "int_gui.frx":0476
Style = 2 'Dropdown List
TabIndex = 1
Top = 240
Width = 2172
End
Begin VB.CheckBox Check11
Alignment = 1 'Right Justify
Appearance = 0 'Flat
BackColor = &H8000000A&
Enabled = 0 'False
ForeColor = &H80000008&
Height = 192
Left = 3720
TabIndex = 19
Top = 1440
Value = 1 'Checked
Width = 252
End
Begin VB.CheckBox Check9
Alignment = 1 'Right Justify
Appearance = 0 'Flat
BackColor = &H8000000A&
Enabled = 0 'False
ForeColor = &H80000008&
Height = 192
Left = 3000
TabIndex = 18
TabStop = 0 'False
Top = 1680
Value = 1 'Checked
Width = 252
End
Begin VB.CheckBox Check8
Alignment = 1 'Right Justify
Appearance = 0 'Flat
BackColor = &H8000000A&
Enabled = 0 'False
ForeColor = &H80000008&
Height = 192
Left = 3000
TabIndex = 17
TabStop = 0 'False
Top = 1440
Value = 1 'Checked
Width = 252
End
Begin VB.CheckBox Check7
Alignment = 1 'Right Justify
Appearance = 0 'Flat
BackColor = &H8000000A&
Enabled = 0 'False
ForeColor = &H80000008&
Height = 192
Left = 3000
TabIndex = 16
TabStop = 0 'False
Top = 1200
UseMaskColor = -1 'True
Value = 1 'Checked
Width = 252
End
Begin VB.CheckBox Check6
Appearance = 0 'Flat
BackColor = &H8000000A&
Enabled = 0 'False
ForeColor = &H80000008&
Height = 192
Left = 2280
TabIndex = 15
Top = 1680
Value = 1 'Checked
Width = 252
End
Begin VB.CheckBox Check3
Appearance = 0 'Flat
BackColor = &H8000000A&
Enabled = 0 'False
ForeColor = &H80000008&
Height = 192
Left = 1800
TabIndex = 14
Top = 1680
Value = 1 'Checked
Width = 252
End
Begin VB.CheckBox Check2
Appearance = 0 'Flat
BackColor = &H8000000A&
Enabled = 0 'False
ForeColor = &H80000008&
Height = 192
Left = 1800
TabIndex = 13
Top = 1440
Value = 1 'Checked
Width = 252
End
Begin VB.Label Label8
Alignment = 2 'Center
Caption = "Win95 Win98 WinNT4.0 Win2000"
Height = 252
Left = 1392
TabIndex = 12
Top = 960
Width = 2940
End
Begin VB.Label Label7
Caption = "12: Mouse"
Height = 252
Left = 240
TabIndex = 11
Top = 1680
Width = 852
End
Begin VB.Label Label6
Caption = "6: Floppy Disk (A:)"
Height = 252
Left = 240
TabIndex = 10
Top = 1440
Width = 1572
End
Begin VB.Label Label5
Caption = "1: Keyboard."
Height = 252
Left = 240
TabIndex = 9
Top = 1200
Width = 1092
End
Begin VB.Label Label4
Caption = "Common IRQs:"
Height = 252
Left = 120
TabIndex = 8
Top = 720
Width = 1212
End
Begin VB.Line Line1
BorderWidth = 2
DrawMode = 14 'Copy Pen
X1 = 120
X2 = 4200
Y1 = 660
Y2 = 660
End
Begin VB.Label Label3
Caption = "Select IRQ:"
Height = 252
Left = 120
TabIndex = 7
Top = 300
Width = 960
End
End
Begin VB.TextBox IntCount
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H80000018&
Enabled = 0 'False
Height = 285
Left = 3480
TabIndex = 4
TabStop = 0 'False
Text = "0"
Top = 2400
Width = 735
End
Begin VB.CommandButton DisEnInt_Button
Caption = "Enable Interrupt"
Height = 372
Left = 480
TabIndex = 0
Top = 2280
Width = 1572
End
Begin VB.CommandButton Exit_Button
Caption = "Exit"
Height = 372
Left = 3240
TabIndex = 3
Top = 2880
Width = 1215
End
Begin VB.CommandButton About_Button
Caption = "About"
Height = 372
Left = 600
TabIndex = 2
Top = 2880
Width = 1215
End
Begin VB.Label Label1
Caption = "Interrupt count:"
Height = 252
Left = 2280
TabIndex = 5
Top = 2400
Width = 1212
End
End
Attribute VB_Name = "int_gui"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'
' File - int_gui.frm - code
'
' This application catches interrupts that are genereted by the
' computer components, and is controlled via a graphical user
' interface - int_gui.frm
' The interrupts are detected using WinDriver functions.
'
Private hWD As Long
Private lastIrq As Integer
Private CurIrq As Integer
Dim fStart As Boolean
Private Sub About_Button_Click()
MsgBox "Interrupt listener Sample v1.0" & Chr$(13) & Chr$(13) & _
"This sample catches hardware interrupts" & Chr$(13) _
& " through the WinDriver's Visual Basic interface." _
& Chr$(13) & Chr$(13) & "Copyright (c) 2000 Jungo" _
, vbOKOnly, "About the Interrupt listener Sample"
End Sub
Private Sub Exit_Button_Click()
If (fStart) Then
Interrupt_Thread_Disable hWD
End If
Int_Close hWD
Unload int_gui
End Sub
Private Sub Form_Load()
int_gui.ReqIrqList.ListIndex = 1
lastIrq = 1
CurIrq = 1
If (Not Int_Open(hWD)) Then
Unload int_gui
GoTo finish
End If
fStart = False
finish:
End Sub
Private Sub DisEnInt_Button_Click()
fStart = Not fStart
If (fStart) Then
If (Check_ReqIrq) Then
If (Not Interrupt_Thread_Enable(hWD, g_intrp, CurIrq)) Then
fStart = Not fStart
CurIrq = lastIrq
int_gui.ReqIrqList.ListIndex = lastIrq
Else
int_gui.DisEnInt_Button.Caption = "Disable IRQ " & int_gui.ReqIrqList.ListIndex
End If
Else
fStart = Not fStart
End If
Else
int_gui.DisEnInt_Button.Caption = "Enable Interrupt"
Interrupt_Thread_Disable hWD
End If
End Sub
Private Function Check_ReqIrq() As Boolean
Dim status
If (int_gui.ReqIrqList.ListIndex = CurIrq) Then
int_gui.IntCount = 0
Check_ReqIrq = True
GoTo finish
End If
status = MsgBox("Not all the IRQs are sharable. Listen to some" & Chr$(13) _
& "of them may be harmful to your application." & Chr$(13) _
& Chr$(13) & " Are you sure ?", vbYesNo + vbQuestion, "Did you know")
If (status <> vbYes) Then
int_gui.ReqIrqList.ListIndex = CurIrq
Check_ReqIrq = False
GoTo finish
End If
lastIrq = CurIrq
CurIrq = int_gui.ReqIrqList.ListIndex
int_gui.IntCount = 0
Check_ReqIrq = True
finish:
End Function
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If (UnloadMode = vbFormControlMenu) Then
Exit_Button_Click
End If
End Sub